*******************************************
*        Wartime Elections: 2004          *
* Logitudinal Analysis of Bush's Approval *
*     Full Series (1/2001 - 11/2005)      *
*******************************************


calendar 1978 1 12
allocate 2005:11
open data approval_78-05.txt
data(format=free,org=obs) / overall foreign economic bush

*** Source Files

source bjident.src
source info.src
source rgser.src
source dfunit.src
source kpss.src
source vratio.src
source fif.src
source arf500.src


*** Differencing

diff overall / overalld
diff foreign / foreignd
diff economic / economicd


*** Interactions

set bforeign = foreign * bush
set beconomic = economic * bush


*** Unit Root Tests

@dfunit(ttest) overall
@dfunit(ttest) foreign
@dfunit(ttest) economic


*** Fractional Integration

@rgser overalld
@rgser foreignd
@rgser economicd

@fif(d=0) overalld / overalldf
@fif(d=-0.12) foreignd / foreigndf
@fif(d=0) economicd / economicdf

set bforeignd = foreignd * bush
set beconomicd = economicd * bush

*** Models
smpl
boxjenk(ar=2,ma=||2||,iterations=1000,inputs=5,constant,vcv) overalld / res1
# foreignd 0 0 0
# economicd  0 0 0
# bush 0 0 0
# bforeignd 0 0 0
# beconomicd 0 0 0
@bjident res1
@info

smpl 1978:04 2000:12
boxjenk(ar=2,ma=||2||,iterations=1000,inputs=2,constant,vcv) overalld / res2
# foreignd 0 0 0
# economicd  0 0 0
@bjident res2
restrict 1
# 5     6
# 1.0   -1.0   0.0

smpl 2001:01 2005:11
boxjenk(ar=1,ma=||2||,iterations=1000,inputs=2,constant) overalld / res2
# foreignd 0 0 0
# economicd  0 0 0
@bjident res2
restrict 1
# 4     5
# 1.0   -1.0   0.0





